API Documentation
RelativeLayout.h
1 // RelativeLayout.h
3 //
5 
6 namespace nkWinUi
7 {
11  enum class RELATIVE_POSITION
12  {
13  UNKNOWN = 0,
14  LEFT,
15  RIGHT,
16  OVER,
17  UNDER,
18  OVER_LEFT,
19  OVER_RIGHT,
20  UNDER_LEFT,
22  } ;
23 }
24 
25 namespace nkWinUi
26 {
30  class DLL_WINUI_EXPORT RelativeLayout final : public Layout
31  {
32  public :
33 
42 
43  // Getters
48  Component* getComponentAt (unsigned int index) ;
49 
50  // Setters
54  virtual void setParentComponent (Component* parent) override ;
55 
56  // Components
65  void addComponent (Component* component, const nkMaths::Rectangle& area) ;
74  void addComponent (Component* component, const nkMaths::Rectangle& area, RELATIVE_POSITION position, Component* relativeTo) ;
78  virtual void removeComponent (Component* component) override ;
79 
80  // Update
84  virtual void update () override ;
85 
86  // Import / Export
90  virtual void exportComponentsNodeEntry (nkExport::Node* rootNode) override ;
94  virtual void processComponentsNodeEntry (nkExport::Node* rootNode) override ;
95  } ;
96 }
nkWinUi::RelativeLayout::addComponent
void addComponent(Component *component, const nkMaths::Rectangle &area, RELATIVE_POSITION position, Component *relativeTo)
nkWinUi::RELATIVE_POSITION::UNDER_LEFT
@ UNDER_LEFT
Under left (diagonal) of the anchor.
nkWinUi::RELATIVE_POSITION::OVER_LEFT
@ OVER_LEFT
Top left (diagonal) of the anchor.
nkWinUi::RelativeLayout::getComponentAt
Component * getComponentAt(unsigned int index)
nkWinUi::RELATIVE_POSITION::LEFT
@ LEFT
Left of anchor.
nkWinUi::Layout
Represents a layout to organize sub-windows in a window.
Definition: Layout.h:12
nkWinUi::RelativeLayout::~RelativeLayout
~RelativeLayout()
nkWinUi::RelativeLayout::setParentComponent
virtual void setParentComponent(Component *parent) override
nkWinUi::RelativeLayout::exportComponentsNodeEntry
virtual void exportComponentsNodeEntry(nkExport::Node *rootNode) override
nkWinUi::Component
Base class for any graphical component.
Definition: Component.h:12
nkWinUi::RelativeLayout
Implements a layout positioning its children components relative to each other.
Definition: RelativeLayout.h:31
nkWinUi::RELATIVE_POSITION::UNKNOWN
@ UNKNOWN
By default, when unknown. Not relative to anything.
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkWinUi::RELATIVE_POSITION::UNDER
@ UNDER
Under the anchor.
nkWinUi::RELATIVE_POSITION::OVER
@ OVER
Over, top of the anchor.
nkWinUi::RELATIVE_POSITION::RIGHT
@ RIGHT
Right of anchor.
nkWinUi::RelativeLayout::removeComponent
virtual void removeComponent(Component *component) override
nkMaths::Rectangle
Represents a 2D rectangle.
Definition: Rectangle.h:12
nkWinUi::RelativeLayout::RelativeLayout
RelativeLayout()
nkWinUi::RelativeLayout::update
virtual void update() override
nkWinUi
Encompasses all API of component NilkinsWinUi.
Definition: Button.h:7
nkWinUi::RELATIVE_POSITION::OVER_RIGHT
@ OVER_RIGHT
Top right (diagonal) of the anchor.
nkWinUi::RELATIVE_POSITION
RELATIVE_POSITION
Represents different positions, compared to an anchor.
Definition: RelativeLayout.h:12
nkWinUi::RelativeLayout::processComponentsNodeEntry
virtual void processComponentsNodeEntry(nkExport::Node *rootNode) override
nkWinUi::RELATIVE_POSITION::UNDER_RIGHT
@ UNDER_RIGHT
Under right (diagonal) of the anchor.
nkWinUi::RelativeLayout::addComponent
void addComponent(Component *component, const nkMaths::Rectangle &area)